package com.example.ecommerce.util;

public class MCode {
    private final String type;
    private final String code;
    private final String desc;

    public MCode(String type, String code, String desc) {
        this.type = type;
        this.code = code;
        this.desc = desc;
    }

    public String get(Object... args) {
        return I18nUtil.getMessageStr(this, args);
    }

    public String getMsg() {
        return this.type + ":" + this.code + " " + this.desc;
    }

    public String getType() {
        return this.type;
    }

    public String getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof MCode)) {
            return false;
        } else {
            MCode other = (MCode)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$type = this.getType();
                Object other$type = other.getType();
                if (this$type == null) {
                    if (other$type != null) {
                        return false;
                    }
                } else if (!this$type.equals(other$type)) {
                    return false;
                }

                Object this$code = this.getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }

                Object this$desc = this.getDesc();
                Object other$desc = other.getDesc();
                if (this$desc == null) {
                    if (other$desc != null) {
                        return false;
                    }
                } else if (!this$desc.equals(other$desc)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof MCode;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $type = this.getType();
        result = result * 59 + ($type == null ? 43 : $type.hashCode());
        Object $code = this.getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        Object $desc = this.getDesc();
        result = result * 59 + ($desc == null ? 43 : $desc.hashCode());
        return result;
    }

    public String toString() {
        String var10000 = this.getType();
        return "MCode(type=" + var10000 + ", code=" + this.getCode() + ", desc=" + this.getDesc() + ")";
    }
}
